package com.lhkj.ct.meta.admin.model.dto;

import com.lhkj.ct.base.enums.DataScope;
import com.lhkj.ct.base.enums.GlobalStatus;
import com.lhkj.ct.base.validator.group.ValGroups;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * 描述
 * </p>
 *
 * @author job
 * @since 2023/9/12
 */
@Data
public class RoleForm {

    @NotBlank(message = "角色id不能为空", groups = {ValGroups.Update.class})
    @ApiModelProperty(value = "主键")
    private String id;

    @NotBlank(message = "请输入角色名称", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @Length(max = 50, message = "角色名称不能超过{max}字", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "角色名称")
    private String name;

    @NotBlank(message = "请输入角色编码", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @Length(max = 15, message = "角色编码不能超过{max}字", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "角色编码")
    private String code;

    @NotNull(message = "请选择可查看的数据权限", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "数据权限", notes = "0.全部数据 1.机构数据 2.部门及子部门数据 3.本部门数据 4.本人数据")
    private DataScope dataScope;

    @NotNull(message = "请选择角色状态", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "角色状态", allowableValues = "0或1", notes = "0.正常 1.禁用")
    private GlobalStatus status;

    @ApiModelProperty(value = "角色备注")
    private String note;

    @NotNull(message = "请输入排序", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "排序")
    private Integer sort;

    @NotEmpty(message = "请选择角色对应的权限", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "菜单对应权限集合")
    private List<String> menuIds;
}
